<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>Parallel Gaussian Process Regression: src/pgpr_util.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Parallel Gaussian Process Regression
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   <div id="projectbrief">The implementation of parallel Gaussian process (GP) regression is based on the following publication: Jie Chen, Nannan Cao, Kian Hsiang Low, Ruofei Ouyang, Colin Keng-Yan Tan &amp; Patrick Jaillet. Parallel Gaussian Process Regression with Low-Rank Covariance Matrix Approximations. In Proceedings of the 29th Conference on Uncertainty in Artificial Intelligence (UAI 2013), Bellevue, WA, Jul 11-15, 2013.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">pgpr_util.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>This file contains a collection of useful functions such as macro-like inline functions, debug functions, exception handling, file I/O, and a real-time timer class.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;sys/time.h&gt;</code><br />
<code>#include &lt;Eigen/Dense&gt;</code><br />
<code>#include &quot;<a class="el" href="pgpr__type_8h_source.html">pgpr_type.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pgpr__chol_8h_source.html">pgpr_chol.h</a>&quot;</code><br />
</div>
<p><a href="pgpr__util_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpgpr__timer.html">pgpr_timer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This timer class can provide real-time measure (in seconds) incurred by a block of running program.  <a href="classpgpr__timer.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aa43646fbb6338cd32a87689a1418c5d2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa43646fbb6338cd32a87689a1418c5d2"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>LEV_PRG</b>&#160;&#160;&#160;0</td></tr>
<tr class="separator:aa43646fbb6338cd32a87689a1418c5d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1c039318db5129eddc873727383e433"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad1c039318db5129eddc873727383e433"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>LEV_DBG</b>&#160;&#160;&#160;5</td></tr>
<tr class="separator:ad1c039318db5129eddc873727383e433"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e7b32669f7e5c3a29b49e2c9a643bf1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e7b32669f7e5c3a29b49e2c9a643bf1"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>LEV_ALL</b>&#160;&#160;&#160;10</td></tr>
<tr class="separator:a6e7b32669f7e5c3a29b49e2c9a643bf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ce40ad99fc78edc7a7eeb9e86b31f5f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4ce40ad99fc78edc7a7eeb9e86b31f5f"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CURLEV</b>&#160;&#160;&#160;LEV_PRG</td></tr>
<tr class="separator:a4ce40ad99fc78edc7a7eeb9e86b31f5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5f56ec7eece1180dbcf7f5a7d4edead"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac5f56ec7eece1180dbcf7f5a7d4edead"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RANI</b>(x)&#160;&#160;&#160;(Int)((Doub)rand()/RAND_MAX*x)</td></tr>
<tr class="separator:ac5f56ec7eece1180dbcf7f5a7d4edead"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe5d2008788edf24f2dc0a62ffb94969"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe5d2008788edf24f2dc0a62ffb94969"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SRAND</b>(x)&#160;&#160;&#160;srand(x); rand()</td></tr>
<tr class="separator:abe5d2008788edf24f2dc0a62ffb94969"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af855c94dc540e943632089ce7496faac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af855c94dc540e943632089ce7496faac"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>LOG</b>(x)&#160;&#160;&#160;log(x)</td></tr>
<tr class="separator:af855c94dc540e943632089ce7496faac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae52c48592a33f8f3db9592f7be0502f3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae52c48592a33f8f3db9592f7be0502f3"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SQRT</b>(x)&#160;&#160;&#160;sqrt(x)</td></tr>
<tr class="separator:ae52c48592a33f8f3db9592f7be0502f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a179978530f93b1e13bc48dc40dc1960e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a179978530f93b1e13bc48dc40dc1960e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>EXP</b>(x)&#160;&#160;&#160;exp(x)</td></tr>
<tr class="separator:a179978530f93b1e13bc48dc40dc1960e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3fdc89d294523ce27c49c1c4b34f558"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad3fdc89d294523ce27c49c1c4b34f558"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>POW</b>(x, y)&#160;&#160;&#160;(Int)pow((Doub)(x),(Doub)(y))</td></tr>
<tr class="separator:ad3fdc89d294523ce27c49c1c4b34f558"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2f81ff1d494a8318e0128d6e5af2e2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2f81ff1d494a8318e0128d6e5af2e2d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>takeSamp</b>(a, b, d)&#160;&#160;&#160;for(int _i=0; _i&lt;d; _i++) b[_i]=a[_i]</td></tr>
<tr class="separator:ab2f81ff1d494a8318e0128d6e5af2e2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93cc594b7df033d58071d897f081b005"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a93cc594b7df033d58071d897f081b005"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>pcp</b>(x)&#160;&#160;&#160;pmsg(LEV_DBG,stdout,&quot;CheckPoint&gt; %d\n&quot;,x)</td></tr>
<tr class="separator:a93cc594b7df033d58071d897f081b005"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ff6be3f8adfcef1fc19e702e2dcfa4a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1ff6be3f8adfcef1fc19e702e2dcfa4a"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>pcpst</b>(x)&#160;&#160;&#160;pmsg(LEV_DBG,stdout,&quot;[%d] start&gt;\n&quot;,x)</td></tr>
<tr class="separator:a1ff6be3f8adfcef1fc19e702e2dcfa4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06e6ee74d7ca48f7ce8fa6d551d5806e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a06e6ee74d7ca48f7ce8fa6d551d5806e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>pcpen</b>(x)&#160;&#160;&#160;pmsg(LEV_DBG,stdout,&quot;[%d] end# \n&quot;,x)</td></tr>
<tr class="separator:a06e6ee74d7ca48f7ce8fa6d551d5806e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98483c18e8e701f60018f324695cc6d5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98483c18e8e701f60018f324695cc6d5"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>pcp_s</b>(s, x)&#160;&#160;&#160;pmsg(LEV_DBG,stdout,&quot; %s &gt; %.4lf\n&quot;,s,(double)x)</td></tr>
<tr class="separator:a98483c18e8e701f60018f324695cc6d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e4b06dca33a33b367a54984d96a865a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>pvec</b>(vec)</td></tr>
<tr class="separator:a6e4b06dca33a33b367a54984d96a865a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31ced2132f69ef00cd11ce2476869ded"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>pvec_r</b>(vec, vsize)</td></tr>
<tr class="separator:a31ced2132f69ef00cd11ce2476869ded"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a6ab0f9f8e25b0210247dd2a9682a32"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>pvec_s</b>(_s, vec)</td></tr>
<tr class="separator:a9a6ab0f9f8e25b0210247dd2a9682a32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfb3f244639b4a9e03b8677d09453de1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>pmat_r</b>(mat, _r)</td></tr>
<tr class="separator:adfb3f244639b4a9e03b8677d09453de1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9be447bf3f4b14fd989ce9fc57aa63bd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>pmat_pos</b>(mat)</td></tr>
<tr class="separator:a9be447bf3f4b14fd989ce9fc57aa63bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60074f2ab66477e31244f47c57c371d3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>pmat</b>(mat)</td></tr>
<tr class="separator:a60074f2ab66477e31244f47c57c371d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adbce0312b885ab4e47b37e182b2437dc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>pmat_s</b>(_s, mat)</td></tr>
<tr class="separator:adbce0312b885ab4e47b37e182b2437dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9de9d1938b45c8e50010d931da53ab2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9de9d1938b45c8e50010d931da53ab2d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>throw</b>(message)&#160;&#160;&#160;{printf(&quot;ERROR: %s\n     in file %s at line %d\n&quot;, message,__FILE__,__LINE__); throw(1);}</td></tr>
<tr class="separator:a9de9d1938b45c8e50010d931da53ab2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a06d1c40d0369212d1b6fa6ecd3bb9fbd"><td class="memTemplParams" colspan="2"><a class="anchor" id="a06d1c40d0369212d1b6fa6ecd3bb9fbd"></a>
template&lt;class T &gt; </td></tr>
<tr class="memitem:a06d1c40d0369212d1b6fa6ecd3bb9fbd"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><b>SQR</b> (const T a)</td></tr>
<tr class="separator:a06d1c40d0369212d1b6fa6ecd3bb9fbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a209bcb7d618351acd2e2ae728a0a4a03"><td class="memTemplParams" colspan="2"><a class="anchor" id="a209bcb7d618351acd2e2ae728a0a4a03"></a>
template&lt;class T &gt; </td></tr>
<tr class="memitem:a209bcb7d618351acd2e2ae728a0a4a03"><td class="memTemplItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><b>MAX</b> (const T &amp;a, const T &amp;b)</td></tr>
<tr class="separator:a209bcb7d618351acd2e2ae728a0a4a03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af81927aa1249cf37ac3750267885b120"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af81927aa1249cf37ac3750267885b120"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>MAX</b> (const double &amp;a, const float &amp;b)</td></tr>
<tr class="separator:af81927aa1249cf37ac3750267885b120"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e7d146382ee63a63057d0d1da21681c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3e7d146382ee63a63057d0d1da21681c"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>MAX</b> (const float &amp;a, const double &amp;b)</td></tr>
<tr class="separator:a3e7d146382ee63a63057d0d1da21681c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e57865c72ea6681c364d10f79cf175a"><td class="memTemplParams" colspan="2"><a class="anchor" id="a9e57865c72ea6681c364d10f79cf175a"></a>
template&lt;class T &gt; </td></tr>
<tr class="memitem:a9e57865c72ea6681c364d10f79cf175a"><td class="memTemplItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><b>MIN</b> (const T &amp;a, const T &amp;b)</td></tr>
<tr class="separator:a9e57865c72ea6681c364d10f79cf175a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cfa98af017775923db28dc7c2e20172"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2cfa98af017775923db28dc7c2e20172"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>MIN</b> (const double &amp;a, const float &amp;b)</td></tr>
<tr class="separator:a2cfa98af017775923db28dc7c2e20172"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d33ecea9b81bb92f8eea3582752aa9a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d33ecea9b81bb92f8eea3582752aa9a"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>MIN</b> (const float &amp;a, const double &amp;b)</td></tr>
<tr class="separator:a3d33ecea9b81bb92f8eea3582752aa9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5bb90632c74845e7dc3cb8c46a1fbdd"><td class="memTemplParams" colspan="2"><a class="anchor" id="ac5bb90632c74845e7dc3cb8c46a1fbdd"></a>
template&lt;class T &gt; </td></tr>
<tr class="memitem:ac5bb90632c74845e7dc3cb8c46a1fbdd"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><b>SIGN</b> (const T &amp;a, const T &amp;b)</td></tr>
<tr class="separator:ac5bb90632c74845e7dc3cb8c46a1fbdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a050c6451d15aaccc09c71cc4a383b8f7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a050c6451d15aaccc09c71cc4a383b8f7"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>SIGN</b> (const float &amp;a, const double &amp;b)</td></tr>
<tr class="separator:a050c6451d15aaccc09c71cc4a383b8f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae9be2b78e310ebaae80d3a980ef37c3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aae9be2b78e310ebaae80d3a980ef37c3"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>SIGN</b> (const double &amp;a, const float &amp;b)</td></tr>
<tr class="separator:aae9be2b78e310ebaae80d3a980ef37c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c47ab41142fb494373b0b511cfe219b"><td class="memTemplParams" colspan="2"><a class="anchor" id="a7c47ab41142fb494373b0b511cfe219b"></a>
template&lt;class T &gt; </td></tr>
<tr class="memitem:a7c47ab41142fb494373b0b511cfe219b"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><b>SWAP</b> (T &amp;a, T &amp;b)</td></tr>
<tr class="separator:a7c47ab41142fb494373b0b511cfe219b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21662d98c0459a96314b58776dc8b93c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a21662d98c0459a96314b58776dc8b93c"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>getLines</b> (Char *file)</td></tr>
<tr class="separator:a21662d98c0459a96314b58776dc8b93c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74dc21ad25985bd3063ee0c1e7e1f6a0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a74dc21ad25985bd3063ee0c1e7e1f6a0"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>saveData</b> (Char *file, <a class="el" href="classpgpr__matrix.html">Mdoub</a> m_data)</td></tr>
<tr class="separator:a74dc21ad25985bd3063ee0c1e7e1f6a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a3d131d60e0599da7dca1d27a8ca5b6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1a3d131d60e0599da7dca1d27a8ca5b6"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>loadLocalData</b> (Char *file, MatrixXd &amp;m_data, Int blocksize, Int ss, Int blocks)</td></tr>
<tr class="separator:a1a3d131d60e0599da7dca1d27a8ca5b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2ad6a23533ac3f6f0e7e62b3be917d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac2ad6a23533ac3f6f0e7e62b3be917d7"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>loadLocalData</b> (Char *file, <a class="el" href="classpgpr__matrix.html">Mdoub</a> &amp;m_data, Int blocksize, Int ss, Int blocks)</td></tr>
<tr class="separator:ac2ad6a23533ac3f6f0e7e62b3be917d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4aa30557a4052cc2ed2f07c16d7a5ceb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4aa30557a4052cc2ed2f07c16d7a5ceb"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>loadData</b> (Char *file, <a class="el" href="classpgpr__matrix.html">Mdoub</a> &amp;m_data)</td></tr>
<tr class="separator:a4aa30557a4052cc2ed2f07c16d7a5ceb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68fa4875f454d4304b0452a49655a4d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a68fa4875f454d4304b0452a49655a4d7"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>loadData</b> (Char *file, MatrixXd &amp;m_data)</td></tr>
<tr class="separator:a68fa4875f454d4304b0452a49655a4d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad49a24bf917ce2513e2d78b253e7d538"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad49a24bf917ce2513e2d78b253e7d538"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>saveHyper</b> (Char *file, <a class="el" href="classpgpr__vector.html">Vdoub</a> h, Int d)</td></tr>
<tr class="separator:ad49a24bf917ce2513e2d78b253e7d538"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7bf48c07ed663913fac522d9b20b7225"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7bf48c07ed663913fac522d9b20b7225"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>pmsg</b> (int level, FILE *outfp, const char *format,...)</td></tr>
<tr class="separator:a7bf48c07ed663913fac522d9b20b7225"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aefe36f617c26ccd3ac34138615a6cff3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aefe36f617c26ccd3ac34138615a6cff3"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>bubble_sort</b> (<a class="el" href="classpgpr__vector.html">Vdoub</a> a, <a class="el" href="classpgpr__vector.html">Vint</a> &amp;ai)</td></tr>
<tr class="separator:aefe36f617c26ccd3ac34138615a6cff3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc16d3fa0a3cd13e6a2e536b89cc90aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc16d3fa0a3cd13e6a2e536b89cc90aa"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>argmaxi</b> (<a class="el" href="classpgpr__vector.html">Vdoub</a> v)</td></tr>
<tr class="separator:acc16d3fa0a3cd13e6a2e536b89cc90aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78780768ca462e9007f0b0f314cb308f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a78780768ca462e9007f0b0f314cb308f"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>getRmse</b> (const VectorXd &amp;v1, const VectorXd &amp;v2)</td></tr>
<tr class="separator:a78780768ca462e9007f0b0f314cb308f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9aa57039c4e957f23450281fe5eadef0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9aa57039c4e957f23450281fe5eadef0"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>getMnlp</b> (const VectorXd &amp;v1, const VectorXd &amp;v2, const VectorXd &amp;v3)</td></tr>
<tr class="separator:a9aa57039c4e957f23450281fe5eadef0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09c74a006e3f9cef8c2ff27cb65937d2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a09c74a006e3f9cef8c2ff27cb65937d2"></a>
Doub&#160;</td><td class="memItemRight" valign="bottom"><b>getRmse</b> (<a class="el" href="classpgpr__vector.html">Vdoub</a> v1, <a class="el" href="classpgpr__vector.html">Vdoub</a> v2)</td></tr>
<tr class="separator:a09c74a006e3f9cef8c2ff27cb65937d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace8da99b106d77c09cdabccb5640cb32"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ace8da99b106d77c09cdabccb5640cb32"></a>
Doub&#160;</td><td class="memItemRight" valign="bottom"><b>getMnlp</b> (<a class="el" href="classpgpr__vector.html">Vdoub</a> v1, <a class="el" href="classpgpr__vector.html">Vdoub</a> v2, <a class="el" href="classpgpr__vector.html">Vdoub</a> v3)</td></tr>
<tr class="separator:ace8da99b106d77c09cdabccb5640cb32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04a40c19efa77e2b6d593b78a4613403"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a04a40c19efa77e2b6d593b78a4613403"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>A_invB_C</b> (<a class="el" href="classpgpr__matrix.html">Mdoub</a> A, <a class="el" href="classpgpr__chol.html">pgpr_chol</a> *chol_b, <a class="el" href="classpgpr__vector.html">Vdoub</a> C, <a class="el" href="classpgpr__vector.html">Vdoub</a> &amp;D)</td></tr>
<tr class="separator:a04a40c19efa77e2b6d593b78a4613403"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f6c2b463bef982481ac02b170fdef06"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f6c2b463bef982481ac02b170fdef06"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>A_invB_C</b> (<a class="el" href="classpgpr__matrix.html">Mdoub</a> A, <a class="el" href="classpgpr__chol.html">pgpr_chol</a> *chol_b, <a class="el" href="classpgpr__matrix.html">Mdoub</a> C, <a class="el" href="classpgpr__matrix.html">Mdoub</a> &amp;D)</td></tr>
<tr class="separator:a9f6c2b463bef982481ac02b170fdef06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8cc9714e7a5f09be2e4e4059d5cc92b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab8cc9714e7a5f09be2e4e4059d5cc92b"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>A_invB_transC</b> (<a class="el" href="classpgpr__matrix.html">Mdoub</a> A, <a class="el" href="classpgpr__chol.html">pgpr_chol</a> *chol_b, <a class="el" href="classpgpr__matrix.html">Mdoub</a> C, <a class="el" href="classpgpr__matrix.html">Mdoub</a> &amp;D)</td></tr>
<tr class="separator:ab8cc9714e7a5f09be2e4e4059d5cc92b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6443f4b0f6f61a1d9dd728abb5be1ad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6443f4b0f6f61a1d9dd728abb5be1ad"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>A_invB_C</b> (<a class="el" href="classpgpr__matrix.html">Mdoub</a> A, <a class="el" href="classpgpr__chol.html">pgpr_chol</a> *chol_b, <a class="el" href="classpgpr__matrix.html">Mdoub</a> &amp;D)</td></tr>
<tr class="separator:aa6443f4b0f6f61a1d9dd728abb5be1ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37044eb169b448f91f70ac9dca469aa5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a37044eb169b448f91f70ac9dca469aa5"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>trace_A_invB_C</b> (<a class="el" href="classpgpr__matrix.html">Mdoub</a> A, <a class="el" href="classpgpr__chol.html">pgpr_chol</a> *chol_b, <a class="el" href="classpgpr__matrix.html">Mdoub</a> C, <a class="el" href="classpgpr__vector.html">Vdoub</a> &amp;D)</td></tr>
<tr class="separator:a37044eb169b448f91f70ac9dca469aa5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a964f05f3b78789c4db237324ea4f6ef0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a964f05f3b78789c4db237324ea4f6ef0"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>trace_A_invB_C</b> (<a class="el" href="classpgpr__matrix.html">Mdoub</a> A, <a class="el" href="classpgpr__chol.html">pgpr_chol</a> *chol_b, <a class="el" href="classpgpr__vector.html">Vdoub</a> &amp;D)</td></tr>
<tr class="separator:a964f05f3b78789c4db237324ea4f6ef0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8bd15de42604e1b283dd5dd64378471"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa8bd15de42604e1b283dd5dd64378471"></a>
Int&#160;</td><td class="memItemRight" valign="bottom"><b>trace_A_invB_transC</b> (<a class="el" href="classpgpr__matrix.html">Mdoub</a> A, <a class="el" href="classpgpr__chol.html">pgpr_chol</a> *chol_b, <a class="el" href="classpgpr__matrix.html">Mdoub</a> C, <a class="el" href="classpgpr__vector.html">Vdoub</a> &amp;D)</td></tr>
<tr class="separator:aa8bd15de42604e1b283dd5dd64378471"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This file contains a collection of useful functions such as macro-like inline functions, debug functions, exception handling, file I/O, and a real-time timer class. </p>
<dl class="section author"><dt>Author</dt><dd>CHEN jie, <a href="#" onclick="location.href='mai'+'lto:'+'ari'+'k.'+'cj@'+'gm'+'ail'+'.c'+'om'; return false;">arik.<span style="display: none;">.nosp@m.</span>cj@g<span style="display: none;">.nosp@m.</span>mail.<span style="display: none;">.nosp@m.</span>com</a></dd></dl>
<dl class="section version"><dt>Version</dt><dd>1.0 </dd></dl>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a60074f2ab66477e31244f47c57c371d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define pmat</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">mat</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">for</span>(Int _i=0; _i&lt;mat.nrows(); _i++)\</div>
<div class="line">    {\</div>
<div class="line">        for(Int _j=0; _j&lt;mat.ncols(); _j++)\</div>
<div class="line">        {\</div>
<div class="line">            pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%.4f &quot;</span>,(<span class="keywordtype">double</span>)mat[_i][_j]);\</div>
<div class="line">        }\</div>
<div class="line">        pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;\n&quot;</span>);\</div>
<div class="line">    }\</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a9be447bf3f4b14fd989ce9fc57aa63bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define pmat_pos</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">mat</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">for</span>(Int _i=0; _i&lt;mat.nrows(); _i++)\</div>
<div class="line">    {\</div>
<div class="line">        for(Int _j=0; _j&lt;mat.ncols(); _j++)\</div>
<div class="line">        {\</div>
<div class="line">            if(mat[_i][_j]&lt;0) break;\</div>
<div class="line">            pmsg(LEV_DBG,stdout,&quot;%.4f &quot;,(<span class="keywordtype">double</span>)mat[_i][_j]);\</div>
<div class="line">        }\</div>
<div class="line">        pmsg(LEV_DBG,stdout,&quot;\n&quot;);\</div>
<div class="line">    }\</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="adfb3f244639b4a9e03b8677d09453de1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define pmat_r</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">mat, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">_r&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">for</span>(Int _i=0; _i&lt;_r; _i++)\</div>
<div class="line">    {\</div>
<div class="line">        for(Int _j=0; _j&lt;_r; _j++)\</div>
<div class="line">        {\</div>
<div class="line">            pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%.4f &quot;</span>,(<span class="keywordtype">double</span>)mat[_i][_j]);\</div>
<div class="line">        }\</div>
<div class="line">        pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;\n&quot;</span>);\</div>
<div class="line">    }\</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="adbce0312b885ab4e47b37e182b2437dc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define pmat_s</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">_s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">mat&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%s:\n&quot;</span>,_s);\</div>
<div class="line">    for(Int _i=0; _i&lt;mat.nrows(); _i++)\</div>
<div class="line">    {\</div>
<div class="line">        for(Int _j=0; _j&lt;mat.ncols(); _j++)\</div>
<div class="line">        {\</div>
<div class="line">            pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%.4f &quot;</span>,(<span class="keywordtype">double</span>)mat[_i][_j]);\</div>
<div class="line">        }\</div>
<div class="line">        pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;\n&quot;</span>);\</div>
<div class="line">    }\</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a6e4b06dca33a33b367a54984d96a865a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define pvec</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">vec</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">for</span>(Int _j=0; _j&lt;vec.size(); _j++)\</div>
<div class="line">    {\</div>
<div class="line">        pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%.4f &quot;</span>,(<span class="keywordtype">double</span>)vec[_j]);\</div>
<div class="line">    }\</div>
<div class="line">    pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;\n&quot;</span>);</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a31ced2132f69ef00cd11ce2476869ded"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define pvec_r</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">vec, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">vsize&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">for</span>(Int _j=0; _j&lt;vsize; _j++)\</div>
<div class="line">    {\</div>
<div class="line">        pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%.4f &quot;</span>,(<span class="keywordtype">double</span>)vec[_j]);\</div>
<div class="line">    }\</div>
<div class="line">    pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;\n&quot;</span>);</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a9a6ab0f9f8e25b0210247dd2a9682a32"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define pvec_s</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">_s, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">vec&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%s:\n&quot;</span>,_s);\</div>
<div class="line">    for(Int _j=0; _j&lt;vec.size(); _j++)\</div>
<div class="line">    {\</div>
<div class="line">        pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;%.4f &quot;</span>,(<span class="keywordtype">double</span>)vec[_j]);\</div>
<div class="line">    }\</div>
<div class="line">    pmsg(LEV_DBG,stdout,<span class="stringliteral">&quot;\n&quot;</span>);</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 5 2015 14:32:10 for Parallel Gaussian Process Regression by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.7
</small></address>
</body>
</html>
